import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.FileInputStream;
import java.util.List;

public class Homework {
    @Test
    public void load() throws DocumentException {
        SAXReader reader = new SAXReader();
        Document document = reader.read(new File("src/books.xml"));
        List<Element> books = document.getRootElement().elements("books");
        for (Element book : books) {
            String id = book.attributeValue("id");
            String name = book.element("name").getText();
            String author = book.element("author").getText();
            String price = book.element("price").getText();

        }
    }
}
